package com.ruoyi.app.controller;

import com.ruoyi.app.domain.ExamReportItem;
import com.ruoyi.app.domain.Examintions;
import com.ruoyi.app.service.ExamReportItemService;
import com.ruoyi.app.service.ExamintionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("reportItem")
public class ExamReportItemController {
    @Autowired
    private ExamReportItemService examReportItemService;
    @Autowired
    private ExamintionsService examintionsService;

    @RequestMapping("list")
    public ExamReportItem list(Long reportId) {
        ExamReportItem list = examReportItemService.list(reportId);
        List<Examintions> examintions = examintionsService.getSelectExamintions(list.getId());
        list.setExamintions(examintions);
        return list;
    }
}
